package stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

//测试生成流StreamAPI
public class TestStream01 {
    public static void main(String[] args) {
        List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
        for (String str :strings) {
            System.out.println(str);
        }
        int String = 5;
        List<String> filtered = strings.stream().filter(string -> !string.isEmpty()).collect(Collectors.toList());
        for (String str :filtered) {
            System.out.println(str);
        }

        
    }
}
